class ScoresController < ApplicationController
	def new
		@s = Score.find_by_player_id_and_board_id params[:player_id], params[:board_id]
		@b = Board.find params[:board_id]
		if @s.nil?
			@s = Score.new
			@s.player_id = params[:player_id]
			@s.board_id = params[:board_id]
		end
	end
	def create
		Score.create(params[:score])
puts params[:score]
		redirect_to players_path
	end
	def index
		@scpres = Score.find :all
	end
	def edit
		@s = Score.find params[:id]
	end
	def update
		@s = Score.find params[:id]
		@s.update_attributes params[:score]
		redirect_to players_path
	end
end
